package com.csylh.util;

import com.csylh.VO.ResponseVO;

/**
 * Created by 留歌
 * Date: 2018/3/12 22:55
 * Description:返回状态码和提示信息工具类
 */
public class ResponseVOUtil {
    //成功，返回code/msg和数据
    public static ResponseVO success(Object obejct){
        ResponseVO responseVO = new ResponseVO();
        responseVO.setCode(0);
        responseVO.setMsg("成功");
        responseVO.setData(obejct);
        return responseVO;
    }
    public static ResponseVO success() {
        return success(null);
    }

    //失败，只返回code/msg
    public static ResponseVO error(String msg){
        ResponseVO responseVO = new ResponseVO();
        responseVO.setCode(0);
        responseVO.setMsg(msg);
        return responseVO;
    }
}
